<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN"><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<title>API Functions</title>
<link rel="stylesheet" type="text/css" href="../../helpFiles/style.css">
</head>
<body><div align="center"><table class="allEncompassingTable"><tr><td>
<h1>Image Plugin API reference</h1>
<p class="infoBox">Plugin for processing images</p>
<h3 class="subsectionBar">
<a name="abs" id="abs"></a>simIM.abs</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates an absolute value of each pixel.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.abs(int handle, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="absdiff" id="absdiff"></a>simIM.absdiff</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element absolute difference between two arrays.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.absdiff(int handle1, int handle2, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="absdiffK" id="absdiffK"></a>simIM.absdiffK</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element absolute difference between an array and a scalar.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.absdiffK(int handle, table k, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>k</strong> (table of float): scalar</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="add" id="add"></a>simIM.add</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element sum of two arrays.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.add(int handle1, int handle2, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="addK" id="addK"></a>simIM.addK</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element sum of an array and a scalar.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.addK(int handle, table k, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>k</strong> (table of float): scalar</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="addWeighted" id="addWeighted"></a>simIM.addWeighted</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the weighted sum of two arrays, i.e. DST(i) = SRC1(i)*alpha + SRC2(i)*beta + gamma.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.addWeighted(int handle1, int handle2, float alpha, float beta, float gamma, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
<div>
<strong>alpha</strong> (float): alpha coefficient</div>
<div>
<strong>beta</strong> (float): beta coefficient</div>
<div>
<strong>gamma</strong> (float): gamma coefficient</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="arrowedLine" id="arrowedLine"></a>simIM.arrowedLine</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Draw a arrow segment starting from (x1,y1) and pointing to (x2,y2).</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.arrowedLine(int handle, table_2 p1, table_2 p2, table_3 color, int thickness=1, int type=8, int shift=0, float tipLength=0.1)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>p1</strong> (table of int, size 2): x, y coordinates of first point</div>
<div>
<strong>p2</strong> (table of int, size 2): x, y coordinates of second point</div>
<div>
<strong>color</strong> (table of int, size 3): color (red, green, blue values in range 0..255)</div>
<div>
<strong>thickness</strong> (int, default: 1): line thickness</div>
<div>
<strong>type</strong> (int, default: 8): type of the line (8 for 8-connected line, 4 for 4-connected line, or 16 for antialiased line)</div>
<div>
<strong>shift</strong> (int, default: 0): number of fractional bits in the point coordinates</div>
<div>
<strong>tipLength</strong> (float, default: 0.1): The length of the arrow tip in relation to the arrow length</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="bitwiseAnd" id="bitwiseAnd"></a>simIM.bitwiseAnd</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element bit-wise conjunction of two arrays.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.bitwiseAnd(int handle1, int handle2, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="bitwiseAndK" id="bitwiseAndK"></a>simIM.bitwiseAndK</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element bit-wise conjunction of an array and a scalar.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.bitwiseAndK(int handle, table k, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>k</strong> (table of float): scalar</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="bitwiseNot" id="bitwiseNot"></a>simIM.bitwiseNot</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Inverts every bit of an array.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.bitwiseNot(int handle, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="bitwiseOr" id="bitwiseOr"></a>simIM.bitwiseOr</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element bit-wise disjunction of two arrays.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.bitwiseOr(int handle1, int handle2, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="bitwiseOrK" id="bitwiseOrK"></a>simIM.bitwiseOrK</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element bit-wise disjunction of an array and a scalar.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.bitwiseOrK(int handle, table k, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>k</strong> (table of float): scalar</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="bitwiseXor" id="bitwiseXor"></a>simIM.bitwiseXor</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element bit-wise exclusive-or of two arrays.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.bitwiseXor(int handle1, int handle2, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="bitwiseXorK" id="bitwiseXorK"></a>simIM.bitwiseXorK</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element bit-wise exclusive-or of an array and a scalar.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.bitwiseXorK(int handle, table k, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>k</strong> (table of float): scalar</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="cart2polar" id="cart2polar"></a>simIM.cart2polar</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates magnitude and angle coordinates of 2D vectors from their x and y coordinates.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle1, int handle2=simIM.cart2polar(int handle1, int handle2, bool angleInDegrees=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image (x)</div>
<div>
<strong>handle2</strong> (int): handle to second image (y)</div>
<div>
<strong>angleInDegrees</strong> (bool, default: false): when true, the function calculates the angle in degrees, otherwise, they are measured in radians</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">
<div>
<strong>handle1</strong> (int): handle of resulting image (magnitude)</div>
<div>
<strong>handle2</strong> (int): handle of resulting image (angle)</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="circle" id="circle"></a>simIM.circle</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Draw a circle with center (cx,cy) and radius r.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.circle(int handle, table_2 center, int radius, table_3 color, int thickness=1, int type=8, int shift=0)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>center</strong> (table of int, size 2): x, y coordinates of center</div>
<div>
<strong>radius</strong> (int): circle radius</div>
<div>
<strong>color</strong> (table of int, size 3): color (red, green, blue values in range 0..255)</div>
<div>
<strong>thickness</strong> (int, default: 1): line thickness (negative values means rect is filled)</div>
<div>
<strong>type</strong> (int, default: 8): type of the line (8 for 8-connected line, 4 for 4-connected line, or 16 for antialiased line)</div>
<div>
<strong>shift</strong> (int, default: 0): number of fractional bits in the point coordinates</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="clipLine" id="clipLine"></a>simIM.clipLine</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Clips the line against the image rectangle.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">bool valid, table_2 p1, table_2 p2=simIM.clipLine(int handle, table_2 p1, table_2 p2)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>p1</strong> (table of int, size 2): x, y coordinates of first point</div>
<div>
<strong>p2</strong> (table of int, size 2): x, y coordinates of second point</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">
<div>
<strong>valid</strong> (bool): false if the line segment is completely outside the image rectangle, otherwise true.</div>
<div>
<strong>p1</strong> (table of int, size 2): x, y coordinates of first point</div>
<div>
<strong>p2</strong> (table of int, size 2): x, y coordinates of second point</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="closeVideoCapture" id="closeVideoCapture"></a>simIM.closeVideoCapture</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Close video capture device.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.closeVideoCapture(int deviceIndex)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>deviceIndex</strong> (int): device index (0 based)</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="compare" id="compare"></a>simIM.compare</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Performs the per-element comparison of two arrays.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.compare(int handle1, int handle2, int op, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
<div>
<strong>op</strong> (int): comparison operator</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="compareK" id="compareK"></a>simIM.compareK</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Performs the per-element comparison of an array and scalar value.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.compareK(int handle, table k, int op, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>k</strong> (table of float): scalar</div>
<div>
<strong>op</strong> (int): comparison operator</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="convert" id="convert"></a>simIM.convert</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Convert the image to a different format.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.convert(int handle, int format, float scale=1.0, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>format</strong> (int): target image format (see <a href="#enum:format">simIM.format</a>)</div>
<div>
<strong>scale</strong> (float, default: 1.0): scale factor</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to the converted image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="copy" id="copy"></a>simIM.copy</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Copy a (portion of) image to another image.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.copy(int srcHandle, table_2 srcOffset, int dstHandle, table_2 dstOffset, table_2 size)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>srcHandle</strong> (int): handle to source image</div>
<div>
<strong>srcOffset</strong> (table of int, size 2): x, y offset in the source image</div>
<div>
<strong>dstHandle</strong> (int): handle to destination image</div>
<div>
<strong>dstOffset</strong> (table of int, size 2): x, y offset in the destination image</div>
<div>
<strong>size</strong> (table of int, size 2): size (width, height) of the copied region</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="create" id="create"></a>simIM.create</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Create an image with given size</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.create(int width, int height, int format=sim_im_fmt_8UC3, int initialValue=0)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>width</strong> (int): width</div>
<div>
<strong>height</strong> (int): height</div>
<div>
<strong>format</strong> (int, default: sim_im_fmt_8UC3): image format (see <a href="#enum:format">simIM.format</a>)</div>
<div>
<strong>initialValue</strong> (int, default: 0): initial value to fill matrix with</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="createFromData" id="createFromData"></a>simIM.createFromData</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Create an image from given raw data</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.createFromData(int width, int height, string data, int format=sim_im_fmt_8UC3)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>width</strong> (int): width</div>
<div>
<strong>height</strong> (int): height</div>
<div>
<strong>data</strong> (string): image data</div>
<div>
<strong>format</strong> (int, default: sim_im_fmt_8UC3): image format (see <a href="#enum:format">simIM.format</a>)</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="destroy" id="destroy"></a>simIM.destroy</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Destroy (i.e.: free memory) an image with given handle</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.destroy(int handle)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>handle</strong> (int): handle to image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="distanceTransform" id="distanceTransform"></a>simIM.distanceTransform</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the distance to the closest zero pixel for each pixel of the source image.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.distanceTransform(int handle, int distanceType=sim_im_dist_L2, int maskSize=sim_im_masksize_precise, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>distanceType</strong> (int, default: sim_im_dist_L2): type of distance (see <a href="#enum:dist">simIM.dist</a>)</div>
<div>
<strong>maskSize</strong> (int, default: sim_im_masksize_precise): mask size (see <a href="#enum:masksize">simIM.masksize</a>)</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="divide" id="divide"></a>simIM.divide</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element division of two arrays.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.divide(int handle1, int handle2, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="divideK" id="divideK"></a>simIM.divideK</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element division of a scalar by an array.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.divideK(table k, int handle, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>k</strong> (table of float): scalar</div>
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="ellipse" id="ellipse"></a>simIM.ellipse</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Draw an ellipse with center (cx,cy) and axes (rx,ry) points in the image.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.ellipse(int handle, table_2 center, table_2 radius, float angle=0.0, float startAngle=0.0, float endAngle=360.0, table_3 color, int thickness=1, int type=8, int shift=0)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>center</strong> (table of int, size 2): x, y coordinates of center</div>
<div>
<strong>radius</strong> (table of int, size 2): radius along x and y axis</div>
<div>
<strong>angle</strong> (float, default: 0.0): rotation in degrees</div>
<div>
<strong>startAngle</strong> (float, default: 0.0): starting angle of the elliptic arc in degrees</div>
<div>
<strong>endAngle</strong> (float, default: 360.0): ending angle of the elliptic arc in degrees</div>
<div>
<strong>color</strong> (table of int, size 3): color (red, green, blue values in range 0..255)</div>
<div>
<strong>thickness</strong> (int, default: 1): line thickness (negative values means rect is filled)</div>
<div>
<strong>type</strong> (int, default: 8): type of the line (8 for 8-connected line, 4 for 4-connected line, or 16 for antialiased line)</div>
<div>
<strong>shift</strong> (int, default: 0): number of fractional bits in the point coordinates</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exp" id="exp"></a>simIM.exp</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the exponential of every array element.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.exp(int handle, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="fillConvexPoly" id="fillConvexPoly"></a>simIM.fillConvexPoly</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Fills a convex polygon.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.fillConvexPoly(int handle, table points, table_3 color, int type=8, int shift=0)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>points</strong> (table of int): polygon vertices, i.e. {x1, y1, x2, y2, ..., xN, yN}</div>
<div>
<strong>color</strong> (table of int, size 3): color (red, green, blue values in range 0..255)</div>
<div>
<strong>type</strong> (int, default: 8): type of the line (8 for 8-connected line, 4 for 4-connected line, or 16 for antialiased line)</div>
<div>
<strong>shift</strong> (int, default: 0): number of fractional bits in the point coordinates</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="fillPoly" id="fillPoly"></a>simIM.fillPoly</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Fills the area bounded by one or more polygon.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.fillPoly(int handle, table points, table numPoints, table_2 offset, table_3 color, int type=8, int shift=0)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>points</strong> (table of int): contour points, i.e. {c1x1, c1y1, c1x2, c1y2, ..., c1xN1, c1yN1, c2x1, c2y1, ..., c2xN2, c2yN2, ..., cMxNM, cMyNM}</div>
<div>
<strong>numPoints</strong> (table of int): lengths of countours, i.e. {N1, N2, ..., NM}. the sum of numPoints items must be equal to the number of x,y pairs in points.</div>
<div>
<strong>offset</strong> (table of int, size 2): x, y offset for all points</div>
<div>
<strong>color</strong> (table of int, size 3): color (red, green, blue values in range 0..255)</div>
<div>
<strong>type</strong> (int, default: 8): type of the line (8 for 8-connected line, 4 for 4-connected line, or 16 for antialiased line)</div>
<div>
<strong>shift</strong> (int, default: 0): number of fractional bits in the point coordinates</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="flip" id="flip"></a>simIM.flip</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Flips an image around vertical, horizontal, or both axes.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.flip(int handle, int op=0, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>op</strong> (int, default: 0): a flag to specify how to flip the array (see <a href="#enum:flipOp">simIM.flipOp</a>)</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="get" id="get"></a>simIM.get</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Get pixel at specified coordinate.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">table value=simIM.get(int handle, table_2 coord)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>coord</strong> (table of int, size 2): x, y coordinates</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>value</strong> (table of float): value</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="gray2rgb" id="gray2rgb"></a>simIM.gray2rgb</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Convert the specified grayscale image to RGB.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.gray2rgb(int handle, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to the converted image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="handles" id="handles"></a>simIM.handles</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Get all the active handles.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">table handles=simIM.handles()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handles</strong> (table of int): handles</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="hls2rgb" id="hls2rgb"></a>simIM.hls2rgb</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Convert the specified HLS image to RGB.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.hls2rgb(int handle, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to the converted image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="hsv2rgb" id="hsv2rgb"></a>simIM.hsv2rgb</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Convert the specified HSV image to RGB.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.hsv2rgb(int handle, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to the converted image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="line" id="line"></a>simIM.line</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Draw a line segment between (x1,y1) and (x2,y2) points in the image.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.line(int handle, table_2 p1, table_2 p2, table_3 color, int thickness=1, int type=8, int shift=0)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>p1</strong> (table of int, size 2): x, y coordinates of first point</div>
<div>
<strong>p2</strong> (table of int, size 2): x, y coordinates of second point</div>
<div>
<strong>color</strong> (table of int, size 3): color (red, green, blue values in range 0..255)</div>
<div>
<strong>thickness</strong> (int, default: 1): line thickness</div>
<div>
<strong>type</strong> (int, default: 8): type of the line (8 for 8-connected line, 4 for 4-connected line, or 16 for antialiased line)</div>
<div>
<strong>shift</strong> (int, default: 0): number of fractional bits in the point coordinates</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="log" id="log"></a>simIM.log</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the natural logarithm of every array element.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.log(int handle, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="magnitude" id="magnitude"></a>simIM.magnitude</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the magnitude of 2D vectors, i.e. DST(i) = sqrt(SRC1(i)^2, SRC2(i)^2).</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.magnitude(int handle1, int handle2)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="merge" id="merge"></a>simIM.merge</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Merge many single channel images into a multichannel image.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.merge(table handles)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>handles</strong> (table of int): handles to individual channel images</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to merged image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="mixChannels" id="mixChannels"></a>simIM.mixChannels</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Mix many single channel images into many multichannel images.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.mixChannels(table inputHandles, table outputHandles, table fromTo)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>inputHandles</strong> (table of int): handles to input images</div>
<div>
<strong>outputHandles</strong> (table of int): handles to output images</div>
<div>
<strong>fromTo</strong> (table of int): array of index pairs, i.e. {src1,dst1,src2,dst2,...,srcN,dstN}. see here for details</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="multiply" id="multiply"></a>simIM.multiply</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element product of two arrays.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.multiply(int handle1, int handle2, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="openVideoCapture" id="openVideoCapture"></a>simIM.openVideoCapture</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Open video capture device.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.openVideoCapture(int deviceIndex)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>deviceIndex</strong> (int): device index (0 based)</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="phase" id="phase"></a>simIM.phase</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the rotation angle of 2D vectors, i.e. DST(i) = atan2(SRC2(i), SRC1(i)).</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.phase(int handle1, int handle2, bool angleInDegrees=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
<div>
<strong>angleInDegrees</strong> (bool, default: false): when true, the function calculates the angle in degrees, otherwise, they are measured in radians</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="polar2cart" id="polar2cart"></a>simIM.polar2cart</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates x and y coordinates of 2D vectors from their magnitude and angle.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle1, int handle2=simIM.polar2cart(int handle1, int handle2, bool angleInDegrees=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image (magnitude)</div>
<div>
<strong>handle2</strong> (int): handle to second image (angle)</div>
<div>
<strong>angleInDegrees</strong> (bool, default: false): when true, the function calculates the angle in degrees, otherwise, they are measured in radians</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">
<div>
<strong>handle1</strong> (int): handle of resulting image (x)</div>
<div>
<strong>handle2</strong> (int): handle of resulting image (y)</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="polylines" id="polylines"></a>simIM.polylines</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Draw several polygonal curves.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.polylines(int handle, table points, table numPoints, bool isClosed, table_3 color, int thickness=1, int type=8, int shift=0)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>points</strong> (table of int): curve points, i.e. {c1x1, c1y1, c1x2, c1y2, ..., c1xN1, c1yN1, c2x1, c2y1, ..., c2xN2, c2yN2, ..., cMxNM, cMyNM}</div>
<div>
<strong>numPoints</strong> (table of int): lengths of curves, i.e. {N1, N2, ..., NM}. the sum of numPoints items must be equal to the number of x,y pairs in points.</div>
<div>
<strong>isClosed</strong> (bool): Flag indicating whether the drawn polylines are closed or not. If they are closed, the function draws a line from the last vertex of each curve to its first vertex.</div>
<div>
<strong>color</strong> (table of int, size 3): color (red, green, blue values in range 0..255)</div>
<div>
<strong>thickness</strong> (int, default: 1): line thickness</div>
<div>
<strong>type</strong> (int, default: 8): type of the line (8 for 8-connected line, 4 for 4-connected line, or 16 for antialiased line)</div>
<div>
<strong>shift</strong> (int, default: 0): number of fractional bits in the point coordinates</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="pow" id="pow"></a>simIM.pow</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Raises every array element to a power.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.pow(int handle, float power, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>power</strong> (float): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="read" id="read"></a>simIM.read</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Read an image from the specified file.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.read(string filename)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>filename</strong> (string): file name</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="readFromVideoCapture" id="readFromVideoCapture"></a>simIM.readFromVideoCapture</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Read frame from video capture device.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.readFromVideoCapture(int deviceIndex, int handle=-1)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>deviceIndex</strong> (int): device index (0 based)</div>
<div>
<strong>handle</strong> (int, default: -1): handle to existing image, or -1 to create and return a new image</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to new image (or existing image if given)</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="readFromVisionSensor" id="readFromVisionSensor"></a>simIM.readFromVisionSensor</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Read image from vision sensor.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.readFromVisionSensor(int sensorHandle, int handle=-1)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>sensorHandle</strong> (int): handle to vision sensor</div>
<div>
<strong>handle</strong> (int, default: -1): handle to existing image, or -1 to create and return a new image</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to new image (or existing image if given)</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="rectangle" id="rectangle"></a>simIM.rectangle</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Draw a rectangle with corners (x1,y1) and (x2,y2) points in the image.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.rectangle(int handle, table_2 p1, table_2 p2, table_3 color, int thickness=1, int type=8, int shift=0)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>p1</strong> (table of int, size 2): x, y coordinates of top-left corner</div>
<div>
<strong>p2</strong> (table of int, size 2): x, y coordinates of bottom-right corner</div>
<div>
<strong>color</strong> (table of int, size 3): color (red, green, blue values in range 0..255)</div>
<div>
<strong>thickness</strong> (int, default: 1): line thickness (negative values means rect is filled)</div>
<div>
<strong>type</strong> (int, default: 8): type of the line (8 for 8-connected line, 4 for 4-connected line, or 16 for antialiased line)</div>
<div>
<strong>shift</strong> (int, default: 0): number of fractional bits in the point coordinates</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="reduce" id="reduce"></a>simIM.reduce</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Reduces a matrix to a vector.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.reduce(int handle, int dim, int op, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>dim</strong> (int): dimension index along which the matrix is reduced. 0 means that the matrix is reduced to a single row. 1 means that the matrix is reduced to a single column.</div>
<div>
<strong>op</strong> (int): reduction operation (see <a href="#enum:reduceOp">simIM.reduceOp</a>)</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="repeat" id="repeat"></a>simIM.repeat</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Fills the output array with repeated copies of the input array.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.repeat(int handle, int nx, int ny, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>nx</strong> (int): how many times the src is repeated along the horizontal axis</div>
<div>
<strong>ny</strong> (int): how many times the src is repeated along the vertical axis</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="resize" id="resize"></a>simIM.resize</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Resize an image and return the resized image (original image is not modified).</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.resize(int handle, int width, int height, int interpolation=sim_im_interp_linear, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>width</strong> (int): width of the new image</div>
<div>
<strong>height</strong> (int): height of the new image</div>
<div>
<strong>interpolation</strong> (int, default: sim_im_interp_linear): type of interpolation (see <a href="#enum:interp">simIM.interp</a>)</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to resized image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="rgb2gray" id="rgb2gray"></a>simIM.rgb2gray</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Convert the specified RGB image to gray.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.rgb2gray(int handle, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to the converted image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="rgb2hls" id="rgb2hls"></a>simIM.rgb2hls</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Convert the specified RGB image to HLS.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.rgb2hls(int handle, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to the converted image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="rgb2hsv" id="rgb2hsv"></a>simIM.rgb2hsv</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Convert the specified RGB image to HSV.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.rgb2hsv(int handle, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle to the converted image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="scaleAdd" id="scaleAdd"></a>simIM.scaleAdd</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the sum of a scaled array and another array, i.e. DST(i) = SRC1(i)*scale + SRC2(i).</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.scaleAdd(int handle1, int handle2, float alpha, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
<div>
<strong>alpha</strong> (float): scale coefficient</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="set" id="set"></a>simIM.set</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Set pixel at specified coordinate.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.set(int handle, table_2 coord, table value)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>coord</strong> (table of int, size 2): x, y coordinates</div>
<div>
<strong>value</strong> (table of float): value</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="size" id="size"></a>simIM.size</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Get the size of an image.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">table_2 size=simIM.size(int handle)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>handle</strong> (int): handle to image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>size</strong> (table of int, size 2): size (width, height) of the image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="split" id="split"></a>simIM.split</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Split a multichannel image.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">table handles=simIM.split(int handle)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>handle</strong> (int): handle to image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handles</strong> (table of int): handles to individual channel images</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="sqrt" id="sqrt"></a>simIM.sqrt</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the square root of every array element.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.sqrt(int handle, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="subtract" id="subtract"></a>simIM.subtract</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element difference of two arrays.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.subtract(int handle1, int handle2, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle1</strong> (int): handle to first image</div>
<div>
<strong>handle2</strong> (int): handle to second image</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="subtractK" id="subtractK"></a>simIM.subtractK</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the per-element difference of an array and a scalar.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int handle=simIM.subtractK(int handle, table k, bool inPlace=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>k</strong> (table of float): scalar</div>
<div>
<strong>inPlace</strong> (bool, default: false): if true, the original immage will be converted in place. otherwise, the original image will not be modified and a new image is returned.</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>handle</strong> (int): handle of resulting image</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="text" id="text"></a>simIM.text</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Drawn a text string.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.text(int handle, string str, table_2 pos, int fontFace=sim_im_fontface_simplex, bool italic=false, float fontScale=1.0, table_3 color, int thickness=1, int type=8, bool bottomLeftOrigin=false)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>str</strong> (string): text string to be drawn</div>
<div>
<strong>pos</strong> (table of int, size 2): x, y coordinates of the origin (bottom-left corner of the string)</div>
<div>
<strong>fontFace</strong> (int, default: sim_im_fontface_simplex): font face (see <a href="#enum:fontFace">simIM.fontFace</a>)</div>
<div>
<strong>italic</strong> (bool, default: false): if true text will have italic style</div>
<div>
<strong>fontScale</strong> (float, default: 1.0): font scale</div>
<div>
<strong>color</strong> (table of int, size 3): color (red, green, blue values in range 0..255)</div>
<div>
<strong>thickness</strong> (int, default: 1): thickness used to draw a text</div>
<div>
<strong>type</strong> (int, default: 8): type of the line (8 for 8-connected line, 4 for 4-connected line, or 16 for antialiased line)</div>
<div>
<strong>bottomLeftOrigin</strong> (bool, default: false): When true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="textSize" id="textSize"></a>simIM.textSize</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Calculates the width and height of a text string.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int width, int height, int baseline=simIM.textSize(string str, int fontFace=sim_im_fontface_simplex, bool italic=false, float fontScale=1.0, int thickness=1)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>str</strong> (string): text string to be drawn</div>
<div>
<strong>fontFace</strong> (int, default: sim_im_fontface_simplex): font face (see <a href="#enum:fontFace">simIM.fontFace</a>)</div>
<div>
<strong>italic</strong> (bool, default: false): if true text will have italic style</div>
<div>
<strong>fontScale</strong> (float, default: 1.0): font scale</div>
<div>
<strong>thickness</strong> (int, default: 1): thickness used to draw a text</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">
<div>
<strong>width</strong> (int): width of the text</div>
<div>
<strong>height</strong> (int): height of the text</div>
<div>
<strong>baseline</strong> (int): y-coordinate of the baseline relative to the bottom-most text point</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="write" id="write"></a>simIM.write</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Write the image with given handle to a file.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.write(int handle, string filename)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>filename</strong> (string): file name</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="writeToVisionSensor" id="writeToVisionSensor"></a>simIM.writeToVisionSensor</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Write image to vision sensor. Make sure the vision sensor is flagged as external input.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simIM.writeToVisionSensor(int handle, int sensorHandle)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>handle</strong> (int): handle to image</div>
<div>
<strong>sensorHandle</strong> (int): handle to vision sensor</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><br><br><h1>Constants</h1>
<p>Constants used in the various functions. Refer to each constant using <i>enumName.constantName</i>, i.e. <b>simUI.curve_type.xy</b> for <b>xy</b> constant in <b>simUI.curve_type</b> enum.</p>
<h3 class="subsectionBar">
<a name="enum:format" id="enum:format"></a>simIM.format</h3>
<table class="apiConstantsTable"><tbody><tr><td>
<div>
<strong>_8UC1</strong>: 1 channel, 8 bit unsigned int</div>
<div>
<strong>_8UC3</strong>: 3 channels, 8 bit unsigned int</div>
<div>
<strong>_8UC4</strong>: 4 channels, 8 bit unsigned int</div>
<div>
<strong>_32FC1</strong>: 1 channel, 32 bit float</div>
<div>
<strong>_32FC3</strong>: 3 channels, 32 bit float</div>
<div>
<strong>_32FC4</strong>: 4 channels, 32 bit float</div>
</td></tr></tbody></table>
<h3 class="subsectionBar">
<a name="enum:interp" id="enum:interp"></a>simIM.interp</h3>
<table class="apiConstantsTable"><tbody><tr><td>
<div>
<strong>nearest</strong>: nearest-neighbor interpolation</div>
<div>
<strong>linear</strong>: bilinear interpolation</div>
<div>
<strong>area</strong>: resampling using pixel area relation (best for shrinking)</div>
<div>
<strong>cubic</strong>: bicubic interpolation over 4x4 pixel neighborhood</div>
<div>
<strong>lanczos4</strong>: Lanczos interpolation over 8x8 pixel neighborhood</div>
</td></tr></tbody></table>
<h3 class="subsectionBar">
<a name="enum:fontFace" id="enum:fontFace"></a>simIM.fontFace</h3>
<table class="apiConstantsTable"><tbody><tr><td>
<div><strong>simplex</strong></div>
<div><strong>plain</strong></div>
<div><strong>duplex</strong></div>
<div><strong>complex</strong></div>
<div><strong>triplex</strong></div>
<div><strong>complex_small</strong></div>
<div><strong>script_simplex</strong></div>
<div><strong>script_complex</strong></div>
</td></tr></tbody></table>
<h3 class="subsectionBar">
<a name="enum:cmpOp" id="enum:cmpOp"></a>simIM.cmpOp</h3>
<table class="apiConstantsTable"><tbody><tr><td>
<div><strong>eq</strong></div>
<div><strong>gt</strong></div>
<div><strong>ge</strong></div>
<div><strong>lt</strong></div>
<div><strong>le</strong></div>
<div><strong>ne</strong></div>
</td></tr></tbody></table>
<h3 class="subsectionBar">
<a name="enum:reduceOp" id="enum:reduceOp"></a>simIM.reduceOp</h3>
<table class="apiConstantsTable"><tbody><tr><td>
<div>
<strong>sum</strong>: the output is the sum of all rows/columns of the matrix.</div>
<div>
<strong>avg</strong>: the output is the mean vector of all rows/columns of the matrix.</div>
<div>
<strong>max</strong>: the output is the maximum (column/row-wise) of all rows/columns of the matrix.</div>
<div>
<strong>min</strong>: the output is the minimum (column/row-wise) of all rows/columns of the matrix.</div>
</td></tr></tbody></table>
<h3 class="subsectionBar">
<a name="enum:flipOp" id="enum:flipOp"></a>simIM.flipOp</h3>
<table class="apiConstantsTable"><tbody><tr><td>
<div>
<strong>x</strong>: flip around the x-axis</div>
<div>
<strong>y</strong>: flip around the y-axis</div>
<div>
<strong>both</strong>: flip around both axes</div>
</td></tr></tbody></table>
<h3 class="subsectionBar">
<a name="enum:dist" id="enum:dist"></a>simIM.dist</h3>
<table class="apiConstantsTable"><tbody><tr><td>
<div><strong>L1</strong></div>
<div><strong>L2</strong></div>
<div><strong>C</strong></div>
</td></tr></tbody></table>
<h3 class="subsectionBar">
<a name="enum:maskSize" id="enum:maskSize"></a>simIM.maskSize</h3>
<table class="apiConstantsTable"><tbody><tr><td>
<div><strong>_3x3</strong></div>
<div><strong>_5x5</strong></div>
<div><strong>_precise</strong></div>
</td></tr></tbody></table>
</td></tr></table></div></body>
</html>
